package com.irdstudio.efp.esb.common.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 马上金融接口接口公共信息
 * 
 * @author ludayong
 * @since 2018年12月28日 上午8:50:27
 * @version 1.0
 */
public class MsLoanConstant {

	// 服务信息
	public final static String TRADE_NO_30220006 = "30220006";// 服务名称：30220006(贷款审批信息管理)
	
	public final static String TRADE_NO_30220007 = "30220007";// 服务名称：30220007(度小满用信结果回调)
	
	public final static String TRADE_NO_30220009 = "30220009";// 服务名称：30220009(度小满用信结果回调)

    public final static String TRADE_NO_40120001 = "40120001";// 服务名称：40120001(联网核查管理)

	public final static String SCENE_01 = "01";// 服务场景名称：01
	
	public final static String SCENE_03 = "03";// 服务场景名称：03

	public final static String SCENE_05 = "05";// 服务场景名称：05

	public final static String DN_STS_0 = "0";// 发放状态：0放款失败

	public final static String DN_STS_1 = "1";// 发放状态：1联合放款成功

	public final static String DN_STS_2 = "2";// 发放状态：2马上全额放款

	public final static String DN_STS_3 = "3";// 发放状态：3待放款

	// 审批状态（网贷贷款申请状态）
	public enum NlsApplyStateEnum {
		// "01" 审批状态（网贷贷款申请状态）：处理中
		// "02" 审批状态（网贷贷款申请状态）：通过
		// "03" 审批状态（网贷贷款申请状态）：拒绝
		// "04" 审批状态（网贷贷款申请状态）：取消
		// "05" 审批状态（网贷贷款申请状态）：挂起
		// "06" 审批状态（网贷贷款申请状态）：审批作废
		APPR("01"), PASS("02"), REJECT("03"), CANCEL("04"), HANG("05"), REVOKED("06");

		public final String VALUE;

		public String getVALUE() {
			return VALUE;
		}

		private NlsApplyStateEnum(String value) {
			this.VALUE = value;
		}
	}
	
	// 平台id 马上：R00001 百度：R00002
	public enum PlafmEnum {
		MS("R00001"), BD("R00002"), YED("E00005");

		public final String VALUE;

		private PlafmEnum(String value) {
			this.VALUE = value;
		}
	}

	// 审核结果 P：通过 R：拒绝
	public enum AudRsltEnum {
		PASS("P"), REJECT("R");

		public final String VALUE;

		private AudRsltEnum(String value) {
			this.VALUE = value;
		}
	}

	public enum DnStsEnum {
		YES("1"), NO("0");// 放款状态 0:待放款 1：已放款

		public final String VALUE;

		private DnStsEnum(String value) {
			this.VALUE = value;
		}
	}

	/* 返回状态码， 000000：交易成功，其他:交易失败 */
	public enum RetCodeEnum {
		SUCCESS("000000"), FAILURE("999999");

		public final String VALUE;

		private RetCodeEnum(String value) {
			this.VALUE = value;
		}
	}
	
	/* 百度照片处理状态 1:待处理 2：成功*/
	public enum BdIdEnum {
		WAIT("1"),SUCCESS("2");

		public final String VALUE;

		private BdIdEnum(String value) {
			this.VALUE = value;
		}
	}
	
	/* 百度RisCode码号   02：成功，其他:失败*/
	public enum RisCodeEnum {
		SUCCESS("02"), FAILURE("03");

		public final String VALUE;

		private RisCodeEnum(String value) {
			this.VALUE = value;
		}
	}
	
	/* 百度拒绝原因 
	 * SXJC001----产品重复授信（授信冲突）
	 * SXJC002----不满足产品要求
	 * SXJC003----年龄不满足
	 * SXJC004----人群分层非A或B
	 * SXJC005----命中关联人
	 * SXJC006----命中行员
	 * SXJC007----命中黑名单
	 * SXJC008----征信规则不通过
	 * SXJC009----重复授信（产品冲突）
	 * YXJC001----超额
	 * YXJC003----客户
	 * RSN999----其他
	 */
	public static Map<String, String> ReasonCodeMap = new HashMap<String,String>();
	static {
		ReasonCodeMap.put("BdAccessRule001", "SXJC003");
		ReasonCodeMap.put("BdAccessRule002", "SXJC005");
		ReasonCodeMap.put("BdAccessRule003", "SXJC002");
		ReasonCodeMap.put("BdAccessRule004", "SXJC006");
		ReasonCodeMap.put("BdAccessRule005", "SXJC004");
		ReasonCodeMap.put("BdAccessRule007", "SXJC001");
		ReasonCodeMap.put("BdAccessRule008", "YXJC001");
		ReasonCodeMap.put("BdAccessRule009", "SXJC009");
		ReasonCodeMap.put("BdAccessRule010", "SXJC007");
		ReasonCodeMap.put("BdAccessRule011", "YXJC003");
		ReasonCodeMap.put("BdAccessRule012", "YXJC001");
		ReasonCodeMap.put("BdAccessRule013", "YXJC002");
		ReasonCodeMap.put("BdAccessRule014", "YXJC001");
		ReasonCodeMap.put("BdAccessRule015", "YXJC002");


		ReasonCodeMap.put("CcrcRule", "SXJC008");
		ReasonCodeMap.put("Other", "QT0001");
	}
	
	public static Map<String, String> ReasonMsgMap = new HashMap<String,String>();
	static {
		ReasonMsgMap.put("BdAccessRule001", "年龄不满足");
		ReasonMsgMap.put("BdAccessRule002", "命中关联人");
		ReasonMsgMap.put("BdAccessRule003", "不满足产品要求");
		ReasonMsgMap.put("BdAccessRule004", "命中行员");
		ReasonMsgMap.put("BdAccessRule005", "人群分层非A或B");
		ReasonMsgMap.put("BdAccessRule007", "重复授信");
		ReasonMsgMap.put("BdAccessRule008", "超额");
		ReasonMsgMap.put("BdAccessRule009", "重复授信");
		ReasonMsgMap.put("BdAccessRule010", "命中黑名单");
		ReasonMsgMap.put("BdAccessRule011", "多头借贷客户");
		ReasonMsgMap.put("BdAccessRule012", "可用额度不足");
		ReasonMsgMap.put("BdAccessRule013", "该客户额度已失效");
		ReasonMsgMap.put("BdAccessRule014", "存在在途贷款申请");
		ReasonMsgMap.put("BdAccessRule015", "授信协议已失效");

		ReasonMsgMap.put("CcrcRule", "征信规则不通过");
		ReasonMsgMap.put("Other", "其他");
	}
	
	/**
	 * 百度期限类型转换
	 */
	public static Map<String, String> TermTypeMap = new HashMap<String,String>();
	static {
		TermTypeMap.put("D", "01");
		TermTypeMap.put("M", "02");
		TermTypeMap.put("Y", "03");
	}
}
